package adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dispatchapp.andlei.R;

import java.util.List;
import bean.CanTeenBean;

public class SieveHomePageCanAdapter extends BaseQuickAdapter<CanTeenBean, BaseViewHolder> {
    public SieveHomePageCanAdapter(int layoutResId, @Nullable List<CanTeenBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CanTeenBean item) {
        helper.setText(R.id.tv_str,item.getName()+"");
        TextView textView = helper.getView(R.id.tv_str);
        if(item.isSelect){
            helper.getView(R.id.item_layout).setBackgroundResource(R.drawable.bianguang);
            textView.setTextColor(Color.parseColor("#00B89D"));
        }else {
            helper.getView(R.id.item_layout).setBackgroundResource(R.drawable.shape_search_fang_bg);
            textView.setTextColor(Color.parseColor("#333333"));
        }
    }
}
